/*﻿/**
 * @file ascii.h
 * @brief this is a brief description
 * @details this is the detail description.
 * @author fulong 
 * @data 7/4/2014
 * @version 1.0
 * @par Copyright (c):
 * @par First build
 *     version: fulong 
 *     data: 7/4/2014
 */
#ifndef __ASCII_H__
#define __ASCII_H__
#include "../../../hal_include/hal_types.h"
#include "../ms_protocol/common.h"

//时钟脉冲是5ms一次
#define MB_1SECONDS 200
#define UNIT MB_1SECONDS
#define SLAVE_DEFAULT_TIMEOUT (UNIT*2) /*!< 从站每个字符接收的超时时间,设为1s */


#define IS_TIMEOUT 1

#define FRAME_LEST_LEN (8*2-3)
#define FRAME_MAX_LEN (256*2)

extern void ascii_mode_init(void);
extern void ascii_receive(void);
extern void ascii_send(void);
extern uint8 ascii_adjust_verify(mb_adu_struct *mb_adu);
extern void ascii_normal_rsp(mb_rsp_pdu_struct*mb_rsp_pdu);
extern void ascii_except_rsp(mb_excep_rsp_pdu_struct*mb_except_pdu);
extern void ascii_receive_frame_function(const uint8 data);
#endif /* __ASCII_H__ */

 

